Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

feat(snapshot): The parameters passed to mksnapshot are now retrieved… #789

Merged
merged 2 commits into from
Feb 6, 2019

Conversation

darind
Copy link
Contributor

@darind darind commented Feb 6, 2019

PR Checklist

Related to NativeScript/android#1263

What is the current behavior?

The parameters passed to the mksnapshot tool are hardcoded in the webpack plugin (for example the --profile_deserialization flag).

What is the new behavior?

The parameters passed to the mksnapshot tool are retrieved from the settings.json file of the installed android runtime. A fallback mechanism is provided for older android runtimes which do not have those parameters.

Why is this change required?

Recent V8 versions (notably >= 7.0) have become very strict on the parameters passed to mksnapshot. They must exactly match the parameters used to create V8's internal snapshot during the compilation process. Otherwise the layout of the snapshot binary might become invalid and result into segmentation faults. Because those parameters are very strictly related to the V8 version it makes more sense to store them as part of the runtime as they might change often.

For reference, here's a related issue in which we have discussed with Google engineers, various crashes related to those parameters: https://bugs.chromium.org/p/v8/issues/detail?id=8576. For example the --turbo_instruction_scheduling flag must now be specified.

@darind darind requested a review from vtrifonov February 6, 2019 14:43
@darind darind force-pushed the darind/v8-7.2.502.24 branch from 91e8eeb to b3a2ffd Compare February 6, 2019 16:38
@darind darind merged commit cb68dac into master Feb 6, 2019
@darind darind deleted the darind/v8-7.2.502.24 branch February 6, 2019 17:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants